package redis;

public class HelloRedis {



    public static void main(String[] args){

//        Jedis jedis = new Jedis("10.20.112.33",6379);
        // 从池中获取一个Jedis对象
/*        Jedis jedis = JedisConfig.pool.getResource();
        System.out.println("Connection to server sucessfully");
        //check whether server is running or not
        System.out.println("Server is running: "+jedis.ping());
        jedis.lpush("wonder-list", "Redis");
        jedis.lpush("wonder-list", "Mongodb");
        jedis.lpush("wonder-list", "Mysql");
        // Get the stored data and print it
        List<String> list = jedis.lrange("wonder-list", 0 ,5);
        for(int i=0; i<list.size(); i++) {
            System.out.println("Stored string in redis:: "+list.get(i));
        }
        // 释放对象池
        JedisConfig.pool.close();*/

    }
}

